Skip to content

ci(vercel): force clean dependency install on every build - #217

Merged
CodeWithMa merged 1 commit into
CodeWithMa:devfrom
CodeWithMaBot:ci/vercel-clean-install
Nov 22, 2026
Merged

CodeWithMa merged 1 commit into
CodeWithMa:devfrom
CodeWithMaBot:ci/vercel-clean-install

Conversation

@CodeWithMaBot

Copy link
Copy Markdown
Contributor

Problem

Vercel preview builds on PRs are flaky. For example, #214 and #216 failed while other PRs from the same Dependabot batch (2026-11-21) passed.

Build log for #216:

Restored build cache from previous deployment (74qjSkh73nCgD5MqTJPbvNbj2h3r)
bun install v1.3.14
...
39 packages installed [1.59s]
$ bun scripts/build.mjs --configuration=production,web
An unhandled exception occurred: Cannot read properties of undefined (reading 'code')
error: script "build" exited with code 127

Vercel restores node_modules from a previous deployment's build cache, and bun install only patches it. The Angular CLI then crashes at startup, before anything compiles. Which cache a build gets depends on timing, so the result varies. Bursts of Dependabot PRs based on different dev commits make this more likely.

The same branch builds fine with a clean install (bun install --frozen-lockfile && bun run build, also with bun 1.3.14). I couldn't reproduce the exact broken cache state locally.

Change

Add vercel.json that overrides the install command so every build starts from a clean node_modules:

{ "installCommand": "rm -rf node_modules && bun install --frozen-lockfile" }

A clean install takes about 4s, so builds slow down very little. --frozen-lockfile also makes Vercel fail loudly if bun.lock and package.json ever drift.

Note

Vercel uses bun 1.3.14 and ignores "packageManager": "bun@1.4.3". This PR doesn't change that.

🤖 Generated with Claude Code

Vercel restores node_modules from a previous deployment's build cache and
bun only patches it incrementally. During Dependabot bursts this left a
broken node_modules (e.g. PR CodeWithMa#216: Angular CLI crashed on startup with
"Cannot read properties of undefined (reading 'code')"), making preview
builds flaky. Removing node_modules before a frozen-lockfile install makes
each build deterministic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@CodeWithMaBot is attempting to deploy a commit to the Ma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e96259ab-b039-44be-b347-e2bf79ed1651
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
watch-list Ready Ready Preview Nov 22, 2026 10:32am UTC

@CodeWithMa
CodeWithMa enabled auto-merge (squash) November 22, 2026 10:36
@CodeWithMa
CodeWithMa merged commit 032df61 into CodeWithMa:dev Nov 22, 2026
9 checks passed
@CodeWithMaBot
CodeWithMaBot deleted the ci/vercel-clean-install branch November 26, 2026 16:56

This branch was successfully deployed

1 active deployment
Preview — b96dbba5 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants